import request from '@/utils/request'
import upload from '@/utils/upload'

export default {
	// 根据类型code获取自身数据
	getTypeByCode(data) {
		return request({
			url: `/ws/systype/info/byCode`,
			method: 'get',
			data
		})
	},
	
	// 根据父类code获取子类数据
	typeChildrenAll(data) {
		return request({
			url: `/ws/systype/childrenByCode`,
			method: 'get',
			data
		})
	},
	
	// 货币类型列表内部调用
	moneyTypeList(data) {
		return request({
			url: `/admin/moneyType/innerList`,
			method: 'get',
			data
		})
	},
	
	// 发送验证码
	sendSms(phoneNumber) {
		return request({
			url: `/ws/sendSms/${phoneNumber}`,
			method: 'get',
		})
	},
	
	// 计算转账
	moneyServiceFee(moneyId, amount) {
		return request({
			url: `/app/money/serviceFee/${moneyId}/${amount}`,
			method: 'get',
		})
	},
	
	// 根据参数键名获取数据
	configInfo(data) {
		return request({
			url: `/ws/sysconfig/getInfo/byKey`,
			method: 'get',
			data
		})
	},
	
	// 图片上传
	uploadFile(data) {
		return upload({
			url: '/common/upload',
			filePath: data
		})
	},
	
	// 根据参数键名查询参数值
	configKey(configKey) {
		return request({
			url: `/system/config/configKey/${configKey}`,
			method: 'get',
		})
	},
}